package org.spider.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author lzy
 * @since 2022-06-02 15:36:46
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("spider_config_channel")
@ApiModel(value = "SpiderConfigChannelEntity对象", description = "")
public class SpiderConfigChannelEntity extends Model<SpiderConfigChannelEntity> {

    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty("频道urlMD5")
    @TableField("channel_url_md5")
    private String channelUrlMd5;

    @ApiModelProperty("频道url")
    @TableField("channel_url")
    private String channelUrl;

    @ApiModelProperty("关联站点id")
    @TableField("channel_site_id")
    private Long channelSiteId;

    @ApiModelProperty("频道名称")
    @TableField("channel_name")
    private String channelName;

    @ApiModelProperty("关联规则id")
    @TableField("channel_rule_id")
    private Long channelRuleId;

    @ApiModelProperty("频道当前状态：1：被关闭；2：未配置；3：已配置；4：已失效")
    @TableField("channel_status")
    private Integer channelStatus;

    @ApiModelProperty("翻页数量，1：不翻页；（默认）；-1：翻到底")
    @TableField("channel_pages")
    private Integer channelPages;

    @ApiModelProperty("关联语言id")
    @TableField("channel_language_id")
    private Long channelLanguageId;

    @ApiModelProperty("采集频率，单位：秒")
    @TableField("channel_crawler_period")
    private Integer channelCrawlerPeriod;

    @ApiModelProperty("关联任务id")
    @TableField("channel_task_config_id")
    private Long channelTaskConfigId;

    @ApiModelProperty("数据来源，1：配置；2：外部导入；3：采集过程中产生")
    @TableField("data_source")
    private Integer dataSource;

    @ApiModelProperty("关联负责人id")
    @TableField("channel_manager_id")
    private Long channelManagerId;

    @ApiModelProperty("频道参数")
    @TableField("channel_params")
    private String channelParams;

    @ApiModelProperty("频道请求头")
    @TableField("channel_headers")
    private String channelHeaders;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


    @Override
    public Serializable pkVal() {
        return this.id;
    }

}
